package edu.unmsm.ocaa.sisocaa.integracion.dao.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.dao.DataAccessException;
import org.springframework.orm.ibatis.support.SqlMapClientDaoSupport;
import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transactional;

import com.ibatis.sqlmap.client.SqlMapClient;

import edu.unmsm.ocaa.sisocaa.integracion.dao.Reporte2DAO;
import edu.unmsm.ocaa.sisocaa.negocio.model.dto.Reporte2DTO;

/**
 * @author cgeronimo
 *
 */
@Repository
public class Reporte2DAOImpl extends SqlMapClientDaoSupport implements Reporte2DAO {


	@Autowired
	public Reporte2DAOImpl(SqlMapClient sqlmap) {
		super.setSqlMapClient(sqlmap);
	}

	@Transactional(readOnly=true)
	public List<Reporte2DTO> getListReporte2Tot(Integer formid)
			throws DataAccessException {
		return (List<Reporte2DTO>)getSqlMapClientTemplate().queryForList("getSubTotalesxPreg", formid);
	}

	@Override
	public List<Reporte2DTO> getListReporte2Porc(Integer formid)
			throws DataAccessException {
		// TODO Auto-generated method stub
		return (List<Reporte2DTO>)getSqlMapClientTemplate().queryForList("getPorcentsxPreg", formid);
	}

}
